import service from '../utils/request'

export function login(data){
    return service({
        url: '/api/login',
        method: 'POST',
        data: data
    })
}

export function register(data){
    return service({
        url: '/api/reg',
        method: 'POST',
        data: data
    })
}

export function getUserInfo(){
    return service({
        url: '/my/userinfo',
        method: 'GET'
    })
}

export function changeUserInfo(data){
    return service({
        url: '/my/userinfo',
        method: 'PUT',
        data
    })
}

export function changeUserPassword(data){
    return service({
        url: '/my/updatepwd',
        method: 'PATCH',
        data
    })
}
export function changeUserPic(data){
    return service({
        url: '/my/update/avatar',
        method: 'PATCH',
        data
    })
}
